#include<stdio.h>
#define _CRT_SECURE_NO_WARNINGS
#define N 3	
#include<stdio.h>
#include<stdlib.h>
#include<math.h>

void fun(int a[3][3], int b[3][3])
{
	int i, j;
	int a1[3][3] = { 0 };
	
	for (i = 0; i < 3; i++)
	{
		for (j = 0; j < 3; j++)
		{
			a1[i][j] = a[j][i];
			b[i][j] = a1[i][j] + a[i][j];
		}
	}
}

main()
{
	int i, j;
	int a[3][3] = { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 } };
	int b[3][3] = { { 1, 4, 7 }, { 2, 5, 8 }, { 3, 6, 9 } };
	fun(a,b);
	for (i = 0; i < 3; i++)
	{
		for (j = 0; j < 3; j++)
		{
			printf("%d ",b[i][j]);
		}
		printf("\n");
	}
}